package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.WcrmGridCustRefService;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author zoie
 */
@RestController
@RequestMapping("/address/transAddressGridInfo")
@Api(tags = "transAddressGridInfo")
public class TransAddressGridInfoResource {
    @Autowired
    private WcrmGridCustRefService service;

    private final Logger log = LoggerFactory.getLogger(TransAddressGridInfoResource.class);

    /**
     * @方法名称: updateAddressGrid
     * @方法描述: 地址网格增量修改
     * @参数与返回说明:
     * @算法描述:
     */
    @PostMapping("/updateAddressGrid")
    @ApiOperation(value = "地址网格增量修改", notes = "地址网格增量修改")
    public ResultDto updateAddressGrid() {
        service.updateAddressGrid();
        return new ResultDto<>();
    }

    /**
     * @方法名称: updateMerchantGrid
     * @方法描述: 商户增量修改
     * @参数与返回说明:
     * @算法描述:
     */
    @PostMapping("/updateMerchantGrid")
    @ApiOperation(value = "商户增量修改", notes = "商户增量修改")
    public ResultDto updateMerchantGrid() {
        service.updateMerchantGrid();
        return new ResultDto<>();
    }


    /**
     * @方法名称:
     * @方法描述: 测试数据地址网格
     * @参数与返回说明:
     * @算法描述:
     */
    @PostMapping("/updateAddressGridNewBak")
    @ApiOperation(value = "地址网格测试数据修改", notes = "地址网格测试数据修改")
    public ResultDto updateAddressGridNewBak() {
        service.updateAddressGridNewBak();
        return new ResultDto<>();
    }

    /**
     * @方法名称: updateMerchantGrid
     * @方法描述: 商户增量修改
     * @参数与返回说明:
     * @算法描述:
     */
    @PostMapping("/updateMerchantTest")
    @ApiOperation(value = "商户测试数据修改", notes = "商户测试数据修改")
    public ResultDto updateMerchantTest() {
        service.updateMerchantTest();
        return new ResultDto<>();
    }

    /**
     * @方法名称: updateMerchantGrid
     * @方法描述: 商户增量修改
     * @参数与返回说明:
     * @算法描述:
     */
    @PostMapping("/updateOrgTest")
    @ApiOperation(value = "机构测试数据修改", notes = "机构测试数据修改")
    public ResultDto updateOrgTest() {
        service.updateOrgTest();
        return new ResultDto<>();
    }

    /**
     * 测试地址转经纬度
     *
     */
    @GetMapping("/testTrans")
    public ResultDto<Map<String,Object>> testTrans(@RequestParam("address") String address){
        return new ResultDto<>(service.testTrans(address));
    }


}



